

package com.scs.application.modules.base.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.model.DataEntity;
import com.scs.application.core.utils.excel.annotation.ExcelAutoColumnSize;
import com.scs.application.core.utils.excel.annotation.ExcelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 商品实体对象
 */
@ExcelAutoColumnSize
@TableName("manufacturer")
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
public class ExcelManufacturerDTO extends DataEntity implements IExcelDataModel, IExcelModel, Serializable {


    private String supplierId;

    @ExcelComment(notNull = true, example = "供应商测试")
    @Excel(name = "供应商名称")
//    @NotNull(message = "供应商名称不能为空")
    private String supplierName;

    /**
     * 厂商名称
     */
    @ExcelComment(notNull = true, example = "厂商测试")
    @Excel(name = "厂商名称", isImportField = "true")
    @NotBlank(message = "厂商名称不能为空")
    @Length(min = 1, max = 100, message = "厂商名称长度必须介于 1 和 100 之间")
    private String name;

    /**
     * 社会信用代码
     */
    @ExcelComment(value = "选填", example = "mfg001")
    @Excel(name = "社会信用代码", isImportField = "true")
    @Length(min = 1, max = 30, message = "社会信用代码长度必须介于 1 和 30 之间")
    private String companyCode;

    /**
     * 生产许可证
     */
    @ExcelComment(value = "选填", example = "")
    @Excel(name = "生产许可证", isImportField = "true")
    @Length(max = 50, message = "生产许可证长度必须介于 0 和 50 之间")
    private String productionLicence;

    /**
     * 助记码
     */
//    @Excel(name = "助记码")
    @Length(max = 10, message = "助记码长度必须介于 0 和 10 之间")
    private String pinyin;

    private Integer rowNum;
    private String errorMsg;

    @Override
    public Integer getRowNum() {
        return rowNum;
    }

    @Override
    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
